from django.test import TestCase
from django.core.management import call_command

from core.models import UnicodeRange
from core.utils.const import UNICODE_RANGES


class FillRangesTestCase(TestCase):
    def setUp(self):
        call_command('fill_ranges')

    def test_all_ranges_were_added_to_database(self):
        for urange in UNICODE_RANGES:
            value, _ = urange

            start, end = value.split('-')

            UnicodeRange.objects.get(start=start, end=end)
